package com.usian.controller;

import com.usian.pojo.Emp;
import com.usian.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("emp")
public class Empcontroller {
    @Autowired
    EmpService empService;
    @RequestMapping("findall")
    public String show(HttpServletRequest request){
        List<Emp> emps=empService.findall();
        request.setAttribute("list",emps);
        return "show";
    }
}
